package com.sylar.general.common;

import java.util.HashMap;
import java.util.Map;

public class RespMsg {
	
	public static Map<String,Object> success(){
		return returnStr(true, "操作成功!",null);
	}
	
	public static Map<String,Object> success(String msg){
		return returnStr(true, msg,null);
	}
	
	
	public static Map<String,Object> fail(){
		return returnStr(false, "操作失败!",null);
	}
	
	public static Map<String,Object> fail(String msg){
		return returnStr(false, msg, null);
	}
	
	private static Map<String,Object> returnStr(boolean status, String msg, Object obj){
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("success", status+"");
		map.put("msg", msg);
		map.put("data", obj==null?obj:"");
		return map;
	}
}
